Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rectangle mesh generation testing #3356

Closed
wants to merge 4 commits into from

Conversation

schnellerhase
Copy link
Contributor

@schnellerhase schnellerhase commented Aug 20, 2024

This introduces explicit (index based) testing of the mesh generation for 2d rectangles. For now only in sequential.

These data structures are needed for more complex test cases (multigrid), following in other PRs.

Also this gives a good baseline/examples for the fixing of #1741

@jpdean
Copy link
Member

jpdean commented Aug 27, 2024

Geometry::input_global_indices might be needed here to avoid hardcoding values

@mscroggs mscroggs added this to the 0.9.0 milestone Sep 3, 2024
@schnellerhase
Copy link
Contributor Author

schnellerhase commented Sep 8, 2024

Geometry::input_global_indices might be needed here to avoid hardcoding values

Thanks for pointing me to this function. I think to make proper use of this and to simplify the tests in this and the related PR's we probably want to split the testing of the generation (everything prior to call to create_mesh) and the mesh generation testing (after redistributing, creating ghost nodes). So we need an interface change. How about something like impl::create_interval_cells -> {x, cells} (and equally for the other mesh types - this should allow for a shared code path for the mesh generation in generation.h all together) that is then called within create_interval to facilitate this?

What remains an open problem with this restructuring would be the question of how to check the mesh parallelization effectively (controlling in test cases which process owns which node and where ghost nodes are generated).

@garth-wells
Copy link
Member

Is this ready, or does it need changes based on @jpdean's comment?

@schnellerhase
Copy link
Contributor Author

I'd say its good to go, and we can adapt later on. Addressing the before mentioned issue will require more changes, than only the tests, so maybe a good idea to separate it from this.

TEMPLATE_TEST_CASE("Rectangle quadrilateral mesh",
"[mesh][rectangle][quadrilateral]", float, double)
{
using T = TestType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is TestType defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is part of the catch macro TEMPLATE_TEST_CASE. Here, its either float or double.

Copy link
Member

@garth-wells garth-wells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering does this add anything over what we can test (more easily) from Python?

@schnellerhase
Copy link
Contributor Author

schnellerhase commented Sep 12, 2024

In principle these tests could be moved to python, I think. Nevertheless I would push for keeping them here in the cpp part. We are strictly unit testing here and thus should avoid as many additional layers as possible.

For example the related tests with parallel cases (in other PRs) currently are not transferable to python due to create_cell_partitioner not working in python as noted in #3362.

@schnellerhase
Copy link
Contributor Author

Superseded by #3359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants